/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package bpmlab.shift.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

/**
 *
 * @author Simeia Lima
 */
@Entity
@Table(name = "transporte")
public class Transporte implements Serializable {

    @Id
    @GeneratedValue
    @Column(name = "id")
    private Long id;
    @Version
    @Column(name = "versao")
    private long versao;
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "data_de_transporte")
    private Date dataDeTransporte;
    @ManyToOne
    private Localizacao localTransporte;
    @ManyToOne
    private Processo processo;

    public Transporte() {
    }

    public Transporte(Date dataDeTransporte) {
        this.dataDeTransporte = dataDeTransporte;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getDataDeTransporte() {
        return dataDeTransporte;
    }

    public void setDataDeTransporte(Date dataDeTransporte) {
        this.dataDeTransporte = dataDeTransporte;
    }

    public Localizacao getLocalTransporte() {
        return localTransporte;
    }

    public void setLocalTransporte(Localizacao localTransporte) {
        this.localTransporte = localTransporte;
    }

    public Processo getProcesso() {
        return processo;
    }

    public void setProcesso(Processo processo) {
        this.processo = processo;
    }
    
    @Override
    public int hashCode() {
        int hash = 7;
        hash = 89 * hash + (int) (this.id ^ (this.id >>> 32));
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Transporte other = (Transporte) obj;
        if (this.id != other.id) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Transporte{" + "id=" + id + ", versao=" + versao + ", dataDeTransporte=" + dataDeTransporte + '}';
    }
    
}
